Conversation
|
e286ca8 to
e332956
Compare
e332956 to
72c583a
Compare
commit: |
72c583a to
80d0c73
Compare
There was a problem hiding this comment.
🔴 Missing convert-oklch preprocessor on vscode platform causes broken color values in tokens.json
The vscode platform (lines 224-238) uses transforms.colorRgb which relies on tinycolor2 for color parsing, but does not have the convert-oklch preprocessor registered. The code's own comment at packages/tokens/src/build.ts:72-75 explicitly states: "Style Dictionary's built-in colorRgb transform uses tinycolor2, which does not support the oklch() color format." The convert-oklch preprocessor was created for exactly this reason and correctly added to the js platform (line 200), but was omitted from the vscode platform. Since the source includes tokens/color-primitives.default.json (which now contains oklch values), and the vscode file has no filter excluding color tokens, all oklch primitive tokens will pass through colorRgb unconverted. tinycolor2 will either leave them as raw oklch strings or produce incorrect RGB values (e.g., rgb(0, 0, 0)). The resulting dist/tokens.json is explicitly exported in package.json and consumed by external tools.
Was this helpful? React with 👍 or 👎 to provide feedback.
9e6a21d to
c8016c8
Compare
c8016c8 to
ee2d0bf
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ee2d0bf. Configure here.
| buildPath: 'dist/', | ||
| transforms: [transforms.nameKebab, transforms.attributeColor], | ||
| preprocessors: ['extensions'], | ||
| preprocessors: ['convert-oklch', 'extensions'], |
There was a problem hiding this comment.
Missing oklch preprocessor on vscode platform
High Severity
The vscode platform uses transforms.colorRgb (which relies on tinycolor2) but doesn't include preprocessors: ['convert-oklch']. The js and figma platforms both correctly include this preprocessor for the same reason. Since tinycolor2 cannot parse oklch() values, color tokens in the tokens.json output will either be raw oklch strings or silently converted to black, producing incorrect colors for VS Code consumers.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit ee2d0bf. Configure here.


Summary
Screenshots (if appropriate):
Testing approaches
Note
Medium Risk
Medium risk because it changes core design-token primitives/aliases (impacting colors across themes) and alters the token build pipeline with a new OKLCH preprocessor and updated source globs.
Overview
Switches color primitives to new OKLCH-based palettes (
neutral,action,positive,negative,warning,info) and rewires color aliases to reference these groups instead of the legacygray/blue/red/green/purpleprimitives.Adds
color-primitives-map(.dark).jsonto preserve backward-compatiblegray/blue/...token names via references, updates Style Dictionary configs/tests/snapshots to include the map, and introduces anoklch()→hex preprocessor so JS/Figma outputs can still run throughcolorRgb.Adds new
shadowtokens and commitsold_tokens/JSON files for reference.Reviewed by Cursor Bugbot for commit ee2d0bf. Bugbot is set up for automated code reviews on this repo. Configure here.